<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>配置 | VuePress</title>
    <meta name="description" content="Vue 驱动的静态网站生成器">
    <link rel="icon" href="/vuepress-theme-purple/logo.png">
  <link rel="manifest" href="/vuepress-theme-purple/manifest.json">
  <meta name="theme-color" content="#3eaf7c">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <link rel="apple-touch-icon" href="/vuepress-theme-purple/icons/apple-touch-icon-152x152.png">
  <link rel="mask-icon" href="/vuepress-theme-purple/icons/safari-pinned-tab.svg" color="#3eaf7c">
  <meta name="msapplication-TileImage" content="/icons/msapplication-icon-144x144.png">
  <meta name="msapplication-TileColor" content="#000000">
    
    <link rel="preload" href="/vuepress-theme-purple/assets/css/0.styles.4750dc60.css" as="style"><link rel="preload" href="/vuepress-theme-purple/assets/js/app.a1c2f8fd.js" as="script"><link rel="preload" href="/vuepress-theme-purple/assets/js/5.ceb67ac2.js" as="script"><link rel="preload" href="/vuepress-theme-purple/assets/js/4.0adfbd1a.js" as="script"><link rel="preload" href="/vuepress-theme-purple/assets/js/64.0987e73f.js" as="script"><link rel="preload" href="/vuepress-theme-purple/assets/js/6.14f6ca82.js" as="script"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/10.a5a6ea3e.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/100.ec2ceaa9.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/101.6dfa1a45.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/102.11915ae0.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/11.2ec43fbc.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/12.e5cec480.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/13.30b10f5f.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/14.9d9396ac.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/15.8e9556f8.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/16.2ce11086.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/17.7bbf8455.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/18.1d45c66b.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/19.0ff815f1.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/20.a19a1201.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/21.0367ba8f.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/22.0b9a8718.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/23.78c12ede.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/24.19cd8818.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/25.5eaa46dc.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/26.f38b21a1.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/27.0785a519.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/28.d23df74d.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/29.2f2dd6ca.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/30.a1bed37f.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/31.7a5b7b61.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/32.2a38681f.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/33.29933d35.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/34.df24a0ef.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/35.23d86e21.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/36.3c551b3f.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/37.832cb8d4.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/38.47f6c955.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/39.6f51d483.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/40.b69df168.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/41.0f0c7aa2.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/42.7b1d48b5.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/43.2c5e9b01.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/44.b339774e.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/45.6206eef7.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/46.119a0a86.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/47.eb84c6c2.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/48.c31f8327.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/49.3e055789.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/50.6c78c9fc.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/51.343c71a0.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/52.76de97d9.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/53.a377d1ca.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/54.8b342bc9.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/55.465812e1.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/56.98edd7cd.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/57.eeca3305.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/58.a58b8904.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/59.f6d4b102.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/60.92072575.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/61.2777f097.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/62.f4effeca.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/63.658ff6dc.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/65.36b268a4.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/66.60412057.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/67.5b563239.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/68.5ecac304.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/69.37c6e078.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/7.18012d7b.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/70.f7a710e9.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/71.24bb765b.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/72.f770f72d.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/73.28783a42.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/74.67fcabaf.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/75.785ce193.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/76.48a6ef71.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/77.a8133ac0.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/78.b950bccd.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/79.846d11a1.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/8.b4abe17a.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/80.e746a20b.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/81.9ad3a7b4.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/82.7daf65f4.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/83.d506c84b.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/84.86d70e47.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/85.45ae9504.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/86.5ecfb585.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/87.a75e695f.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/88.39411bf5.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/89.a18a78c1.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/9.c4d21b85.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/90.45813435.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/91.a9b7f9e9.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/92.3f789f66.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/93.3420f93e.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/94.eac427a9.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/95.2b3fcbfb.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/96.263a20f3.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/97.506fd3ae.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/98.4d8c9524.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/99.ee01147c.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/vendors~flowchart.9a3d1af6.js"><link rel="prefetch" href="/vuepress-theme-purple/assets/js/vendors~notification.1cc30b22.js">
    <link rel="stylesheet" href="/vuepress-theme-purple/assets/css/0.styles.4750dc60.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="navbar-container"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/vuepress-theme-purple/zh/" class="home-link router-link-active"><!----> <span class="site-name">VuePress</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/vuepress-theme-purple/zh/guide/" class="nav-link">指南</a></div><div class="nav-item"><a href="/vuepress-theme-purple/zh/config/" class="nav-link router-link-exact-active router-link-active">配置</a></div><div class="nav-item"><a href="/vuepress-theme-purple/zh/plugin/" class="nav-link">插件</a></div><div class="nav-item"><a href="/vuepress-theme-purple/zh/theme/" class="nav-link">主题</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>API</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/api/cli.html" class="nav-link">CLI</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/api/node.html" class="nav-link">Node</a></li></ul></li><li class="dropdown-item"><h4>开发指南</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/local-development.html" class="nav-link">本地开发</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/design-concepts.html" class="nav-link">设计理念</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/faq/" class="nav-link">FAQ</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/glossary.html" class="nav-link">术语</a></li></ul></li><li class="dropdown-item"><h4>其他</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/migration-guide.html" class="nav-link">从 0.x 迁移</a></li><li class="dropdown-subitem"><a href="https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Changelog
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></li></ul></div></div><div class="nav-item"><a href="https://v0.vuepress.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  0.x
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="选择语言" class="dropdown-title"><span class="title">选择语言</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/vuepress-theme-purple/config/" class="nav-link">English</a></li><li class="dropdown-item"><!----> <a href="/vuepress-theme-purple/zh/config/" class="nav-link router-link-exact-active router-link-active">简体中文</a></li></ul></div></div> <a href="https://github.com/fengxinming/vuepress-theme-purple" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav></div></div></header> <div class="page-container"><div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/vuepress-theme-purple/zh/guide/" class="nav-link">指南</a></div><div class="nav-item"><a href="/vuepress-theme-purple/zh/config/" class="nav-link router-link-exact-active router-link-active">配置</a></div><div class="nav-item"><a href="/vuepress-theme-purple/zh/plugin/" class="nav-link">插件</a></div><div class="nav-item"><a href="/vuepress-theme-purple/zh/theme/" class="nav-link">主题</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>API</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/api/cli.html" class="nav-link">CLI</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/api/node.html" class="nav-link">Node</a></li></ul></li><li class="dropdown-item"><h4>开发指南</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/local-development.html" class="nav-link">本地开发</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/design-concepts.html" class="nav-link">设计理念</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/faq/" class="nav-link">FAQ</a></li><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/glossary.html" class="nav-link">术语</a></li></ul></li><li class="dropdown-item"><h4>其他</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/vuepress-theme-purple/zh/miscellaneous/migration-guide.html" class="nav-link">从 0.x 迁移</a></li><li class="dropdown-subitem"><a href="https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Changelog
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></li></ul></div></div><div class="nav-item"><a href="https://v0.vuepress.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  0.x
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="选择语言" class="dropdown-title"><span class="title">选择语言</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/vuepress-theme-purple/config/" class="nav-link">English</a></li><li class="dropdown-item"><!----> <a href="/vuepress-theme-purple/zh/config/" class="nav-link router-link-exact-active router-link-active">简体中文</a></li></ul></div></div> <a href="https://github.com/fengxinming/vuepress-theme-purple" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>配置</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vuepress-theme-purple/zh/config/#基本配置" class="sidebar-link">基本配置</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#base" class="sidebar-link">base</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#title" class="sidebar-link">title</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#description" class="sidebar-link">description</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#head" class="sidebar-link">head</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#host" class="sidebar-link">host</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#port" class="sidebar-link">port</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#temp" class="sidebar-link">temp</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#dest" class="sidebar-link">dest</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#locales" class="sidebar-link">locales</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#shouldprefetch" class="sidebar-link">shouldPrefetch</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#cache" class="sidebar-link">cache</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#extrawatchfiles" class="sidebar-link">extraWatchFiles</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#patterns" class="sidebar-link">patterns</a></li></ul></li><li><a href="/vuepress-theme-purple/zh/config/#styling" class="sidebar-link">Styling</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#palette-styl" class="sidebar-link">palette.styl</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#index-styl" class="sidebar-link">index.styl</a></li></ul></li><li><a href="/vuepress-theme-purple/zh/config/#主题" class="sidebar-link">主题</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#theme" class="sidebar-link">theme</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#themeconfig" class="sidebar-link">themeConfig</a></li></ul></li><li><a href="/vuepress-theme-purple/zh/config/#pluggable" class="sidebar-link">Pluggable</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#plugins" class="sidebar-link">plugins</a></li></ul></li><li><a href="/vuepress-theme-purple/zh/config/#markdown" class="sidebar-link">Markdown</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#markdown-linenumbers" class="sidebar-link">markdown.lineNumbers</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#markdown-slugify" class="sidebar-link">markdown.slugify</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#markdown-anchor" class="sidebar-link">markdown.anchor</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#markdown-externallinks" class="sidebar-link">markdown.externalLinks</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#markdown-toc" class="sidebar-link">markdown.toc</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#markdown-plugins" class="sidebar-link">markdown.plugins</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#markdown-extendmarkdown" class="sidebar-link">markdown.extendMarkdown</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#markdown-extractheaders" class="sidebar-link">markdown.extractHeaders</a></li></ul></li><li><a href="/vuepress-theme-purple/zh/config/#构建流程" class="sidebar-link">构建流程</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#postcss" class="sidebar-link">postcss</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#stylus" class="sidebar-link">stylus</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#scss" class="sidebar-link">scss</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#sass" class="sidebar-link">sass</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#less" class="sidebar-link">less</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#configurewebpack" class="sidebar-link">configureWebpack</a></li><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#chainwebpack" class="sidebar-link">chainWebpack</a></li></ul></li><li><a href="/vuepress-theme-purple/zh/config/#浏览器兼容性" class="sidebar-link">浏览器兼容性</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vuepress-theme-purple/zh/config/#evergreen" class="sidebar-link">evergreen</a></li></ul></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="配置"><a href="#配置" class="header-anchor">#</a> 配置</h1> <h2 id="基本配置"><a href="#基本配置" class="header-anchor">#</a> 基本配置</h2> <h3 id="base"><a href="#base" class="header-anchor">#</a> base</h3> <ul><li>类型: <code>string</code></li> <li>默认值: <code>/</code></li></ul> <p>部署站点的基础路径，如果你想让你的网站部署到一个子路径下，你将需要设置它。如 GitHub pages，如果你想将你的网站部署到 <code>https://foo.github.io/bar/</code>，那么 <code>base</code> 应该被设置成 <code>&quot;/bar/&quot;</code>，它的值应当总是以斜杠开始，并以斜杠结束。</p> <p><code>base</code> 将会作为前缀自动地插入到所有以 <code>/</code> 开始的其他选项的链接中，所以你只需要指定一次。</p> <p><strong>参考:</strong></p> <ul><li><a href="/vuepress-theme-purple/zh/guide/assets.html#基础路径">Base URL</a></li> <li><a href="/vuepress-theme-purple/zh/guide/deploy.html#github-pages">部署指南 &gt; GitHub Pages</a></li></ul> <h3 id="title"><a href="#title" class="header-anchor">#</a> title</h3> <ul><li>类型: <code>string</code></li> <li>默认值: <code>undefined</code></li></ul> <p>网站的标题，它将会被用作所有页面标题的前缀，同时，默认主题下，它将显示在导航栏（navbar）上。</p> <h3 id="description"><a href="#description" class="header-anchor">#</a> description</h3> <ul><li>类型: <code>string</code></li> <li>默认值: <code>undefined</code></li></ul> <p>网站的描述，它将会以 <code>&lt;meta&gt;</code> 标签渲染到当前页面的 HTML 中。</p> <h3 id="head"><a href="#head" class="header-anchor">#</a> head</h3> <ul><li>类型: <code>Array</code></li> <li>默认值: <code>[]</code></li></ul> <p>额外的需要被注入到当前页面的 HTML <code>&lt;head&gt;</code> 中的标签，每个标签都可以以 <code>[tagName, { attrName: attrValue }, innerHTML?]</code> 的格式指定，举个例子，增加一个自定义的 favicon：</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  head<span class="token operator">:</span> <span class="token punctuation">[</span>
    <span class="token punctuation">[</span><span class="token string">'link'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> rel<span class="token operator">:</span> <span class="token string">'icon'</span><span class="token punctuation">,</span> href<span class="token operator">:</span> <span class="token string">'/logo.png'</span> <span class="token punctuation">}</span><span class="token punctuation">]</span>
  <span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre></div><h3 id="host"><a href="#host" class="header-anchor">#</a> host</h3> <ul><li>类型: <code>string</code></li> <li>默认值: <code>'0.0.0.0'</code></li></ul> <p>指定用于 dev server 的主机名。</p> <h3 id="port"><a href="#port" class="header-anchor">#</a> port</h3> <ul><li>类型: <code>number</code></li> <li>默认值: <code>8080</code></li></ul> <p>指定 dev server 的端口。</p> <h3 id="temp"><a href="#temp" class="header-anchor">#</a> temp</h3> <ul><li>Type: <code>string</code></li> <li>Default: <code>/path/to/@vuepress/core/.temp</code></li></ul> <p>指定客户端文件的临时目录。</p> <h3 id="dest"><a href="#dest" class="header-anchor">#</a> dest</h3> <ul><li>类型: <code>string</code></li> <li>默认值: <code>.vuepress/dist</code></li></ul> <p>指定 <code>vuepress build</code> 的输出目录。如果传入的是相对路径，则会基于 <code>process.cwd()</code> 进行解析。</p> <h3 id="locales"><a href="#locales" class="header-anchor">#</a> locales</h3> <ul><li>类型: <code>{ [path: string]: Object }</code></li> <li>默认值: <code>undefined</code></li></ul> <p>提供多语言支持的语言配置。具体细节请查看 <a href="/vuepress-theme-purple/zh/guide/i18n.html">多语言支持</a>。</p> <h3 id="shouldprefetch"><a href="#shouldprefetch" class="header-anchor">#</a> shouldPrefetch</h3> <ul><li>类型: <code>Function</code></li> <li>默认值: <code>() =&gt; true</code></li></ul> <p>一个函数，用来控制对于哪些文件，是需要生成 <code>&lt;link rel=&quot;prefetch&quot;&gt;</code> 资源提示的。请参考 <a href="https://ssr.vuejs.org/zh/api/#shouldprefetch" target="_blank" rel="noopener noreferrer">shouldPrefetch<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>。</p> <h3 id="cache"><a href="#cache" class="header-anchor">#</a> cache</h3> <ul><li>类型: <code>boolean|string</code></li> <li>默认值: <code>true</code></li></ul> <p>VuePress 默认使用了 <a href="https://github.com/webpack-contrib/cache-loader" target="_blank" rel="noopener noreferrer">cache-loader<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>  来大大地加快 webpack 的编译速度。</p> <p>此选项可以用于指定 cache 的路径，同时也可以通过设置为 <code>false</code> 来在每次构建之前删除 cache。</p> <div class="custom-block tip"><p class="custom-block-title">提示</p> <p>这个选项也可以通过命令行来使用：</p> <div class="language-bash extra-class"><pre class="language-bash"><code>vuepress dev docs --cache .cache <span class="token comment"># 设置 cache 路径</span>
vuepress dev docs --no-cache     <span class="token comment"># 在每次构建前删除 cache</span>
</code></pre></div></div> <h3 id="extrawatchfiles"><a href="#extrawatchfiles" class="header-anchor">#</a> extraWatchFiles</h3> <ul><li>类型: <code>Array</code></li> <li>默认值: <code>[]</code></li></ul> <p>指定额外的需要被监听的文件。</p> <p>你可以监听任何想监听的文件，文件变动将会触发 <code>vuepress</code> 重新构建，并实时更新。</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  extraWatchFiles<span class="token operator">:</span> <span class="token punctuation">[</span>
    <span class="token string">'.vuepress/foo.js'</span><span class="token punctuation">,</span> <span class="token comment">// 使用相对路径</span>
    <span class="token string">'/path/to/bar.js'</span>   <span class="token comment">// 使用绝对路径</span>
  <span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre></div><h3 id="patterns"><a href="#patterns" class="header-anchor">#</a> patterns</h3> <ul><li>Type: <code>Array</code></li> <li>Default: <code>['**/*.md', '**/*.vue']</code></li></ul> <p>Specify which pattern of files you want to be resolved.</p> <h2 id="styling"><a href="#styling" class="header-anchor">#</a> Styling</h2> <h3 id="palette-styl"><a href="#palette-styl" class="header-anchor">#</a> palette.styl</h3> <p>如果要对<a href="https://github.com/vuejs/vuepress/blob/master/packages/@vuepress/core/lib/client/style/config.styl" target="_blank" rel="noopener noreferrer">默认预设<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>的样式进行简单的替换，或者定义一些变量供以后使用，你可以创建一个 <code>.vuepress/styles/palette.styl</code> 文件。</p> <p>你可以调整的一些变量如下:</p> <div class="language-stylus extra-class"><pre class="language-stylus"><code><span class="token comment">// 颜色</span>
<span class="token variable-declaration"><span class="token variable">$accentColor</span> <span class="token operator">=</span> <span class="token hexcode">#3eaf7c</span></span>
<span class="token variable-declaration"><span class="token variable">$textColor</span> <span class="token operator">=</span> <span class="token hexcode">#2c3e50</span></span>
<span class="token variable-declaration"><span class="token variable">$borderColor</span> <span class="token operator">=</span> <span class="token hexcode">#eaecef</span></span>
<span class="token variable-declaration"><span class="token variable">$codeBgColor</span> <span class="token operator">=</span> <span class="token hexcode">#282c34</span></span>
<span class="token variable-declaration"><span class="token variable">$arrowBgColor</span> <span class="token operator">=</span> <span class="token hexcode">#ccc</span></span>
<span class="token variable-declaration"><span class="token variable">$badgeTipColor</span> <span class="token operator">=</span> <span class="token hexcode">#42b983</span></span>
<span class="token variable-declaration"><span class="token variable">$badgeWarningColor</span> <span class="token operator">=</span> <span class="token func"><span class="token function">darken</span><span class="token punctuation">(</span><span class="token hexcode">#ffe564</span><span class="token punctuation">,</span> <span class="token number">35%</span><span class="token punctuation">)</span></span></span>
<span class="token variable-declaration"><span class="token variable">$badgeErrorColor</span> <span class="token operator">=</span> <span class="token hexcode">#DA5961</span></span>

<span class="token comment">// 布局</span>
<span class="token variable-declaration"><span class="token variable">$navbarHeight</span> <span class="token operator">=</span> <span class="token number">3.6</span>rem</span>
<span class="token variable-declaration"><span class="token variable">$sidebarWidth</span> <span class="token operator">=</span> <span class="token number">20</span>rem</span>
<span class="token variable-declaration"><span class="token variable">$contentWidth</span> <span class="token operator">=</span> <span class="token number">740</span>px</span>
<span class="token variable-declaration"><span class="token variable">$homePageWidth</span> <span class="token operator">=</span> <span class="token number">960</span>px</span>

<span class="token comment">// 响应式变化点</span>
<span class="token variable-declaration"><span class="token variable">$MQNarrow</span> <span class="token operator">=</span> <span class="token number">959</span>px</span>
<span class="token variable-declaration"><span class="token variable">$MQMobile</span> <span class="token operator">=</span> <span class="token number">719</span>px</span>
<span class="token variable-declaration"><span class="token variable">$MQMobileNarrow</span> <span class="token operator">=</span> <span class="token number">419</span>px</span>
</code></pre></div><div class="custom-block danger"><p class="custom-block-title">Note</p> <p>你应该<strong>只在</strong>这个文件中定义变量。因为 <code>palette.styl</code> 将在根的 stylus 配置文件的末尾引入，作为配置，它将被多个文件使用，所以一旦你在这里写了样式，你的样式就会被多次复制。</p></div> <h3 id="index-styl"><a href="#index-styl" class="header-anchor">#</a> index.styl</h3> <p>VuePress 提供了一种添加额外样式的简便方法。你可以创建一个 <code>.vuepress/styles/index.styl</code> 文件。这是一个 <a href="http://stylus-lang.com/" target="_blank" rel="noopener noreferrer">Stylus<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 文件，但你也可以使用正常的 CSS 语法。</p> <div class="language-stylus extra-class"><pre class="language-stylus"><code><span class="token selector">.content <span class="token punctuation">{</span></span>
  <span class="token property-declaration"><span class="token property">font-size</span> <span class="token number">30</span>px</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="主题"><a href="#主题" class="header-anchor">#</a> 主题</h2> <h3 id="theme"><a href="#theme" class="header-anchor">#</a> theme</h3> <ul><li>类型: <code>string</code></li> <li>默认值: <code>undefined</code></li></ul> <p>当你使用自定义主题的时候，需要指定它。</p> <p><strong>参考:</strong></p> <ul><li><a href="/vuepress-theme-purple/zh/theme/using-a-theme.html">使用主题</a>.</li></ul> <h3 id="themeconfig"><a href="#themeconfig" class="header-anchor">#</a> themeConfig</h3> <ul><li>类型: <code>Object</code></li> <li>默认值: <code>{}</code></li></ul> <p>为当前的主题提供一些配置，这些选项依赖于你正在使用的主题。</p> <p><strong>也可以参考:</strong></p> <ul><li><a href="/vuepress-theme-purple/zh/theme/default-theme-config.html">默认主题</a>。</li></ul> <h2 id="pluggable"><a href="#pluggable" class="header-anchor">#</a> Pluggable</h2> <h3 id="plugins"><a href="#plugins" class="header-anchor">#</a> plugins</h3> <ul><li>类型: <code>Object|Array</code></li> <li>默认值: <code>undefined</code></li></ul> <p>请参考 <a href="/vuepress-theme-purple/zh/plugin/using-a-plugin.html">plugin &gt; Using a plugin</a> 来使用一个插件。</p> <h2 id="markdown"><a href="#markdown" class="header-anchor">#</a> Markdown</h2> <h3 id="markdown-linenumbers"><a href="#markdown-linenumbers" class="header-anchor">#</a> markdown.lineNumbers</h3> <ul><li>类型: <code>boolean</code></li> <li>默认值: <code>undefined</code></li></ul> <p>是否在每个代码块的左侧显示行号。</p> <p><strong>参考:</strong></p> <ul><li><a href="/vuepress-theme-purple/zh/guide/markdown.html#行号">行号</a></li></ul> <h3 id="markdown-slugify"><a href="#markdown-slugify" class="header-anchor">#</a> markdown.slugify</h3> <ul><li>类型: <code>Function</code></li> <li>默认值: <a href="https://github.com/vuejs/vuepress/tree/master/packages/@vuepress/shared-utils/src/slugify.ts" target="_blank" rel="noopener noreferrer">source<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul> <p>一个将标题文本转换为 slug 的函数。修改它会影响 <a href="/vuepress-theme-purple/zh/miscellaneous/glossary.html#headers">标题</a>、<a href="/vuepress-theme-purple/zh/guide/markdown.html#目录">目录</a>、以及<a href="/vuepress-theme-purple/zh/theme/default-theme-config.html#侧边栏">侧边栏</a>链接的 id 和 链接。</p> <h3 id="markdown-anchor"><a href="#markdown-anchor" class="header-anchor">#</a> markdown.anchor</h3> <ul><li>类型: <code>Object</code></li> <li>默认值: <code>{ permalink: true, permalinkBefore: true, permalinkSymbol: '#' }</code></li></ul> <p><a href="https://github.com/valeriangalliat/markdown-it-anchor" target="_blank" rel="noopener noreferrer">markdown-it-anchor<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 的选项。</p> <h3 id="markdown-externallinks"><a href="#markdown-externallinks" class="header-anchor">#</a> markdown.externalLinks</h3> <ul><li>类型: <code>Object</code></li> <li>默认值: <code>{ target: '_blank', rel: 'noopener noreferrer' }</code></li></ul> <p>这个键值对将会作为特性被增加到是外部链接的 <code>&lt;a&gt;</code> 标签上，默认的选项将会在新窗口中打开一个该外部链接。</p> <h3 id="markdown-toc"><a href="#markdown-toc" class="header-anchor">#</a> markdown.toc</h3> <ul><li>类型: <code>Object</code></li> <li>默认值: <code>{ includeLevel: [2, 3] }</code></li></ul> <p><a href="https://github.com/Oktavilla/markdown-it-table-of-contents" target="_blank" rel="noopener noreferrer">markdown-it-table-of-contents<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 的选项。</p> <h3 id="markdown-plugins"><a href="#markdown-plugins" class="header-anchor">#</a> markdown.plugins</h3> <p>你可以使用 <code>markdown.plugins</code> 来安装 markdown-it 插件。它的使用方法与<a href="/vuepress-theme-purple/zh/plugin/using-a-plugin.html#using-a-plugin">安装一个 VuePress 插件</a>类似。你可以使用 Babel 语法或对象语法。<code>markdown-it-</code> 前缀同样是可以忽略的。</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  markdown<span class="token operator">:</span> <span class="token punctuation">{</span>
    plugins<span class="token operator">:</span> <span class="token punctuation">[</span>
      <span class="token string">'@org/foo'</span><span class="token punctuation">,</span> <span class="token comment">// 等价于 @org/markdown-it-foo，如果对应的包存在</span>
      <span class="token punctuation">[</span><span class="token string">'markdown-it-bar'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
        <span class="token comment">// 提供你的选项</span>
      <span class="token punctuation">}</span><span class="token punctuation">]</span>
    <span class="token punctuation">]</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p>or</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  markdown<span class="token operator">:</span> <span class="token punctuation">{</span>
    plugins<span class="token operator">:</span> <span class="token punctuation">{</span>
      <span class="token string">'@org/foo'</span><span class="token operator">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
      <span class="token string">'markdown-it-bar'</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token comment">// 提供你的选项</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h3 id="markdown-extendmarkdown"><a href="#markdown-extendmarkdown" class="header-anchor">#</a> markdown.extendMarkdown</h3> <ul><li>类型: <code>Function</code></li> <li>默认值: <code>undefined</code></li></ul> <p>一个用于修改当前的 <a href="https://github.com/markdown-it/markdown-it" target="_blank" rel="noopener noreferrer">markdown-it<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 实例的默认配置，或者应用额外的插件的函数，举例如下：</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  markdown<span class="token operator">:</span> <span class="token punctuation">{</span>
    <span class="token function-variable function">extendMarkdown</span><span class="token operator">:</span> <span class="token parameter">md</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
      md<span class="token punctuation">.</span><span class="token function">set</span><span class="token punctuation">(</span><span class="token punctuation">{</span> breaks<span class="token operator">:</span> <span class="token boolean">true</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
      md<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span><span class="token function">require</span><span class="token punctuation">(</span><span class="token string">'markdown-it-xxx'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><div class="custom-block tip"><p class="custom-block-title">提示</p> <p>这个选项也被 <a href="/vuepress-theme-purple/zh/plugin/option-api.html#extendmarkdown">Plugin API</a> 所支持。</p></div> <h3 id="markdown-extractheaders"><a href="#markdown-extractheaders" class="header-anchor">#</a> markdown.extractHeaders</h3> <ul><li>类型: <code>Array</code></li> <li>默认值: <code>['h2', 'h3']</code></li></ul> <p>Markdown 文件的 headers (标题 &amp; 小标题) 会在准备阶段被提取出来，并存储在 <code>this.$page.headers</code> 中。默认情况下，VuePress 会提取 <code>h2</code> 和 <code>h3</code> 标题。你可以通过这个选项来修改提取出的标题级别。</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  markdown<span class="token operator">:</span> <span class="token punctuation">{</span>
    extractHeaders<span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">'h2'</span><span class="token punctuation">,</span> <span class="token string">'h3'</span><span class="token punctuation">,</span> <span class="token string">'h4'</span> <span class="token punctuation">]</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="构建流程"><a href="#构建流程" class="header-anchor">#</a> 构建流程</h2> <h3 id="postcss"><a href="#postcss" class="header-anchor">#</a> postcss</h3> <ul><li>类型: <code>Object</code></li> <li>默认值: <code>{ plugins: [require('autoprefixer')] }</code></li></ul> <p><a href="https://github.com/postcss/postcss-loader" target="_blank" rel="noopener noreferrer">postcss-loader<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 的选项，请注意，指定这个值，将会覆盖内置的 autoprefixer，所以你需要自己将它加进去。</p> <h3 id="stylus"><a href="#stylus" class="header-anchor">#</a> stylus</h3> <ul><li>类型: <code>Object</code></li> <li>默认值: <code>{ preferPathResolver: 'webpack' }</code></li></ul> <p><a href="https://github.com/shama/stylus-loader" target="_blank" rel="noopener noreferrer">stylus-loader<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 的选项。</p> <h3 id="scss"><a href="#scss" class="header-anchor">#</a> scss</h3> <ul><li>类型: <code>Object</code></li> <li>默认值: <code>{}</code></li></ul> <p>加载 <code>*.scss</code> 文件的 <a href="https://github.com/postcss/postcss-loader" target="_blank" rel="noopener noreferrer">sass-loader<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 的选项。</p> <h3 id="sass"><a href="#sass" class="header-anchor">#</a> sass</h3> <ul><li>类型: <code>Object</code></li> <li>默认值: <code>{ indentedSyntax: true }</code></li></ul> <p>加载 <code>*.sass</code> 文件的 <a href="https://github.com/postcss/postcss-loader" target="_blank" rel="noopener noreferrer">sass-loader<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 的选项。</p> <h3 id="less"><a href="#less" class="header-anchor">#</a> less</h3> <ul><li>类型: <code>Object</code></li> <li>Default: <code>{}</code></li></ul> <p><a href="https://github.com/webpack-contrib/less-loader" target="_blank" rel="noopener noreferrer">less-loader<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 的选项。</p> <h3 id="configurewebpack"><a href="#configurewebpack" class="header-anchor">#</a> configureWebpack</h3> <ul><li>类型: <code>Object | Function</code></li> <li>默认值: <code>undefined</code></li></ul> <p>用于修改内部的 Webpack 配置。如果给定一个对象，那么它将会被 <a href="https://github.com/survivejs/webpack-merge" target="_blank" rel="noopener noreferrer">webpack-merge<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 合并到最终的配置中，如果给定一个函数，它将会接受 <code>config</code> 作为第一个参数，以及 <code>isServer</code> 作为第二个参数，你可以直接更改 <code>config</code>，也可以返回一个待合并的对象。</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  <span class="token function-variable function">configureWebpack</span><span class="token operator">:</span> <span class="token punctuation">(</span><span class="token parameter">config<span class="token punctuation">,</span> isServer</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>isServer<span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token comment">// 修改客户端的 webpack 配置</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h3 id="chainwebpack"><a href="#chainwebpack" class="header-anchor">#</a> chainWebpack</h3> <ul><li>类型: <code>Function</code></li> <li>默认值: <code>undefined</code></li></ul> <p>通过 <a href="https://github.com/mozilla-neutrino/webpack-chain" target="_blank" rel="noopener noreferrer">webpack-chain<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 来修改内部的 Webpack 配置。</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  <span class="token function-variable function">chainWebpack</span><span class="token operator">:</span> <span class="token punctuation">(</span><span class="token parameter">config<span class="token punctuation">,</span> isServer</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    <span class="token comment">// config 是 ChainableConfig 的一个实例</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="浏览器兼容性"><a href="#浏览器兼容性" class="header-anchor">#</a> 浏览器兼容性</h2> <h3 id="evergreen"><a href="#evergreen" class="header-anchor">#</a> evergreen</h3> <ul><li>类型: <code>boolean | Function</code></li> <li>默认值: <code>false</code></li></ul> <p>如果你的对象只有那些 “常青树” 浏览器，你可以将其设置成 <code>true</code>，这将会禁止 ESNext 到 ES5 的转译以及对 IE 的 polyfills，同时会带来更快的构建速度和更小的文件体积。</p></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/fengxinming/vuepress-theme-purple/edit/master/zh/config/README.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2020-1-13 1:59:37</span></div></footer> <!----> </main></div></div><div class="global-ui"><!----><!----></div></div>
    <script src="/vuepress-theme-purple/assets/js/app.a1c2f8fd.js" defer></script><script src="/vuepress-theme-purple/assets/js/5.ceb67ac2.js" defer></script><script src="/vuepress-theme-purple/assets/js/4.0adfbd1a.js" defer></script><script src="/vuepress-theme-purple/assets/js/64.0987e73f.js" defer></script><script src="/vuepress-theme-purple/assets/js/6.14f6ca82.js" defer></script>
  </body>
</html>
